{if empty($data.is_mail)}
    <h2 class="pageTitle">Unexpended mothly range</h2>

    <form style="margin: 1em" action="{$data.root}?input=unexpended_mothly_range" method="post">
        Period:
        <select size="1" name="period">
            {foreach from=$data.periods item="period" key="i"}
                <option {if $period==$data.today}selected="selected"{/if} value="{$period}">{$period}</option>
            {/foreach}
        </select>
        <input value="Show" type="submit" />
    </form>
{/if}

{if $data.show == 1}

    <h2 class="pageTitle">Unexpended mothly range for {$data.selectedMonthName} {$data.selectedYear}</h2>

    <table class="list" style="width: auto">
        <tr>
            <td style="text-align: left; padding: 2px 5px;"><strong>Client</strong</td>
            <td style="text-align: right; padding: 2px 5px;"><strong>Prepaid monthly range</strong</td>
            <td style="text-align: right; padding: 2px 5px;"><strong>Unexpended</strong</td>
            {*<td style="text-align: right; padding: 2px 5px;"><strong>Expended</strong</td>*}
        </tr>
        {foreach from=$data.clients item="client"}
            <tr>
                <td style="text-align: left; padding: 2px 5px;">{$client.name}</td>
                <td style="text-align: right; padding: 2px 5px;">{$client.monthlyPrepaid}</td>
                <td style="text-align: right; padding: 2px 5px;">{$client.unexpended}</td>
                {*<td style="text-align: right; padding: 2px 5px;">{$client.expended}</td>*}
            </tr>
        {/foreach}
    </table>

{/if}